#include "CH554.H"
#include "Debug.H"
#include "NRF24L01.h"
#include "SPI.h"
#include "stdio.h"
#include <string.h>

unsigned char  checked = 0;
void main()
{
    CfgFsys();
    mInitSTDIO();


    SPI_Init();
    mDelaymS(200);
//	 LCD_Init();

    printf("start ...\n");
    checked = NRF24L01_Check();
    printf("checked ...%d \n", checked);
    while(NRF24L01_Check());
    printf("checked ...%d \n", checked);

    NRF24L01_Init();
    NRF24L01_TX_Mode();
    nrf24l01_buf[0] = 0x41;
    nrf24l01_buf[1] = 0x42;
    nrf24l01_buf[2] = 0x45;
    nrf24l01_buf[3] = 0x46;
    nrf24l01_buf[4] = 0x43;
//	 unsigned char res;
    while(1)
    {
//		mDelaymS(1000);
//		printf("DEBUG_DATE:"__DATE__"\nDEBUG_TIME:"__TIME__"\n");
//    NRF24L01_TxPacket(nrf24l01_buf);

        mDelaymS(1000);
        NRF24L01_TxPacket(nrf24l01_buf);

        nrf24l01_buf[0] += 5;
        nrf24l01_buf[1] += 5;
        nrf24l01_buf[2] += 5;
        nrf24l01_buf[3] += 5;
        nrf24l01_buf[4] += 5;
    }
}